package com.fqgj.sentry.controller.rm;

import com.fqgj.sentry.biz.rm.RiskTrendBusiness;
import com.fqgj.sentry.biz.rm.vo.CurrentExecutorComboVo;
import com.fqgj.sentry.biz.rm.vo.EventComboVo;
import com.fqgj.sentry.common.cache.RequestLocalInfo;
import com.fqgj.sentry.common.response.ApiOutput;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by ykpbean kangping.ying@yuntu-inc.com
 *
 * @description
 * @create 2017-08-17 上午10:14
 */


@RestController
@RequestMapping(value = "/risk/trend")
public class RiskTrendController {
    @Autowired
    private RiskTrendBusiness riskTrendBusiness;
    
    @RequestMapping(value = "/event/combo", method = RequestMethod.POST)
    public ApiOutput getEventCombo() {
        List<EventComboVo> eventComboVoList = riskTrendBusiness.getEventCombo(RequestLocalInfo.getCurrentAppCode(), RequestLocalInfo.getCurrentMerchantId());
        return new ApiOutput<>("list", eventComboVoList);
    }

    @RequestMapping(value = "/current/{policySetId}/combo", method = RequestMethod.POST)
    public ApiOutput getCurrentExecutorCombo(@PathVariable(value = "policySetId") Long policySetId) {
        List<CurrentExecutorComboVo> currentExecutorComboVos = riskTrendBusiness.getCurrentExecutorCombo(policySetId);
        return new ApiOutput<>("list", currentExecutorComboVos);
    }

}
